package com.example.demo.Switch;


import com.example.demo.Service.AdminlengService;
import com.example.demo.config.SetMsgConfig;
import com.example.demo.entity.GetMsgVo;
import love.forte.simbot.api.message.events.GroupMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GroupSwitchController extends SetMsgConfig {

    @Autowired
    private AdminlengService adminlengService;

    public String groupSwitch(GroupMsg msg)
    {
        GetMsgVo getMsg=getMsgVo(msg);
        switch (getMsg.getFlag())
        {
            case "/删除":
            case "/sc":
                return adminlengService.userDelete(getMsg);
            case "/设置":
            case "/sz":
                return adminlengService.userSet(getMsg);
            case "/查看":
            case "/ck":
                return adminlengService.userSelect(getMsg);
            case "/更新":
            case "/gx":
                return adminlengService.userUpdate(getMsg);
            case "/戳一戳":
            case "/cyc":
                return adminlengService.userCyc(getMsg);
            case "/jrrp":
            case "/今日人品":
                return adminlengService.rand(getMsg);
            default:return "指令错误";
        }
    }
    public String userTake(GroupMsg msg)
    {
        GetMsgVo getMsgVo=getMsgVo(msg);
        return adminlengService.userGet(getMsgVo);
    }
    public String userTake(String msg)
    {
        return adminlengService.userGet(msg);
    }
}
